public class TestAnimal {

    public static int a = 10;
    public static void eat(Animal a) {

        a.eat();
    }

    static {
        a = 20;
        System.out.println("静态代码块");

    }

    public static void main(String[] args) {

        Cat cat = new Cat("元宝", 2);
        Dog dog = new Dog("小七", 1);

        eat(cat);
        eat(dog);
//        a = 30;
//        System.out.println(a);
    }
}
